﻿@model IList<Qu.SeniorProject.Model.StudentGrade>



@section head {

    <link href="@Url.Content("~/Content/GradesTable.css")" rel="stylesheet" type="text/css" />
	<style type="text/css">
		a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
@*        .col1
        {
            width: 100%;
            padding:5px;
        }*@
        textarea 
        {
          display: block;
          width:100%;
          height:100%;
          border:1px solid blue;
        }
        
        label { width: 10em; float: left; }
        label.error { float: none; color: red; padding-left: .5em; vertical-align: top; }
        p { clear: both; }
        .submit { margin-left: 12em; }
        em { font-weight: bold; padding-right: 1em; vertical-align: top; color: red; }
	</style>
}

@{
    //For Faculty members just remove the Layout because this form is opened in a Popup Window
    if (Request.IsAuthenticated && Session["UserInfo"] != null && ((Qu.SeniorProject.Model.UserInfo)Session["UserInfo"]).UserType != "S")
    {
        Layout = null;
    }
}

@{
    ViewBag.Title = "Project Grade Details";
}

@if (ViewBag.ErrorMessage != null)
{
    <h2>@ViewBag.ErrorMessage</h2>;
    return;
}    


<br />
<table>
        <tr>
            <td class="tdProjectSummary">
                ProjectID: 
            </td>
            <td class="tdProjectField">
               
                   <strong>@ViewBag.ProjectSummary.ProjectID</strong>
            </td>
            <td class="tdProjectSummary">
                Project Title: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.Title
            </td>
        </tr>
        <tr>
            <td class="tdProjectSummary">
                Students:
            </td>
            <td class="tdProjectField">
                @Html.Raw(ViewBag.ProjectSummary.Students)
            </td>
            <td class="tdProjectSummary">
                Major: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.Major 
            </td>
        </tr>
@*        <tr>
            <td class="tdProjectSummary">
                Supervisors:
            </td>
            <td class="tdProjectField">
                @Html.Raw(ViewBag.ProjectSummary.Supervisors)
            </td>
            <td class="tdProjectSummary">
                Proposal Examiner: 
            </td>
            <td class="tdProjectField">
                @ViewBag.ProjectSummary.ProposalExaminer
            </td>
        </tr>*@
</table>
<br />
<h2>Grading Summary</h2>
<br />
<table>
    <tr>
        <th>
            StudentName
        </th>
        <th>
            EvaluatedItem
        </th>
@*        <th>
            Examiner
        </th>*@
        <th>
            StudentGrade
        </th>
        <th>
            OutOf
        </th>
        <th>
            LetterGrade
        </th>
@*        <th>
            Weight for Examiner
        </th>*@
@*        <th>
            Comment
        </th>*@
    </tr>
    @{string studentName = string.Empty;
      string examiner = string.Empty;
      string evaluatedItem = string.Empty;
     }
    @foreach (var sg in Model)
    {
        <tr>
            <td>
               <strong>@(studentName == sg.StudentName ? "" : sg.StudentName)
               </strong>
            </td>
            <td>
                @Html.Raw((sg.EvaluatedItem == "Total" ? "<strong>Total</strong>" : (sg.EvaluatedItem == evaluatedItem ? "" : sg.EvaluatedItem)))
            </td>        
@*            <td>
               @(examiner == sg.Examiner ? "" : sg.Examiner)
            </td>*@

            <td>
                @sg.Grade
            </td>
            <td>
                @sg.OutOf
            </td>
            <td>
                <strong>@sg.LetterGrade</strong>@sg.Comment
            </td>
@*            <td>
                @sg.Weight
            </td>*@
@*            <td>
                @sg.Comment
            </td>*@
        </tr>
        
        studentName = sg.StudentName;
        examiner = sg.Examiner;
        evaluatedItem = sg.EvaluatedItem;
    }
</table>
<br />
@Html.Partial("GradeDetails", (IList<Qu.SeniorProject.Model.StudetGradeDetail>)ViewBag.GradeDetails)

<!-- This contains the hidden content for inline calls -->
@*@if (ViewBag.Project !=null)
{
    <div style='display:none'>
        <form action="/Home/EditProject" id="ProjectEditForm" method="post">
                <input type="hidden" name="ProjectId" id="ProjectId" value="@ViewBag.Project.ProjectId" />
                <table>
                <tr><td>
                       <em>*</em><strong>Project Title</strong>
                </td></tr>
                <tr><td align="justify">
                    <input class="required" minlength="20" style="width:100%; border:1px solid blue;" id="ProjectTitle" name="ProjectTitle" type="text" value="@ViewBag.Project.ProjectTitle" />
                </td></tr>
                <tr><td>
                        <em>*</em><strong>Project Abstract (please copy-paste the Project Abstract from the Project Proposal)</strong>
                </td></tr>
                <tr><td >
                    <textarea class="required" minlength="200" id="ProjectDescription" name="ProjectDescription" rows="15">@ViewBag.Project.ProjectDescription</textarea>
                </td></tr>
                <tr><td align="center">
                    <input type="submit" value="Save" id="btnSave" />
                </td></tr>
            </table>
        </form>
    </div>
}*@

<div>
    @Html.ActionLink("Back to Home", "Index")
</div>